import { IsOptional, IsEmail, Matches } from 'class-validator';

export class UpdateUserDto {
  @IsOptional()
  type?: number;

  @IsOptional()
  sex?: number;

  @IsOptional()
  password?: string;

  @Matches(/^1[3-9]\d{9}$/, { message: '手机号码格式错误' })
  @IsOptional()
  mobile?: string;

  @IsEmail({}, { message: '邮箱格式错误' })
  @IsOptional()
  email?: string;

  @IsOptional()
  avatar?: string;

  @IsOptional()
  nickname?: string;

  @IsOptional()
  real_name?: string;

  @IsOptional()
  id_card?: string;

  @IsOptional()
  description?: string;

  @IsOptional()
  label?: string;

  @IsOptional()
  roles?: string[];
}
